<template>
    <el-button text @click="dialogVisible = true">
      click to open the Dialog
    </el-button>
  
    <el-dialog
      v-model="dialogVisible"
      title="Tips"
      width="30%"
    >
      <span>This is a message</span>
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary" @click="close">
            Confirm
          </el-button>
        </span>
      </template>
    </el-dialog>
  </template>
  
  <script setup>
  import { ref } from 'vue'
  import { ElButton, ElDialog } from 'element-plus';
  import 'element-plus/es/components/button/style/css'
  import 'element-plus/es/components/dialog/style/css'
  const dialogVisible = ref(false)
  
  const close = () => {
    dialogVisible.value = false
    console.log(dialogVisible.value)
  }
  </script>
  <style scoped>
  .dialog-footer button:first-child {
    margin-right: 10px;
  }
  </style>